﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.util {
    import Engine.Managers.*;
    import Classes.*;

    public class UpgradesUtil {

        public static function redirectToGiftPage(_arg1:String, _arg2:Array):void{
            var _local5:String;
            var _local6:String;
            var _local3:Item = Global.gameSettings.getItemByName(_arg1);
            if ((((_local3 == null)) || (!(_local3.giftable)))){
                ErrorManager.addError(("Invalid gift: " + _arg1));
                return;
            };
            var _local4:Array = [];
            for each (_local5 in _arg2) {
                if (Global.player.isFriendIDInList(_local5)){
                    _local4.push(_local5);
                } else {
                    ErrorManager.addError(("ID does not belong to a friend: " + _local5));
                };
            };
            _local6 = (((("gifts.php?action=chooseRecipient&gift=" + _arg1) + "&view=limited&include=") + _local4.join("%20")) + "&ref=biz_upgrade");
            FrameManager.navigateTo(_local6);
        }
        public static function calculateCashCostPerUpgradeAction(_arg1:int):int{
            var _local2:Number = Global.gameSettings.getNumber("businessUpgradeActionMultiplier", 0.07);
            var _local3:Number = Global.gameSettings.getNumber("businessUpgradeActionExponent", 0.75);
            var _local4:Number = Global.gameSettings.getNumber("businessUpgradeActionPremium", 1);
            return (Math.ceil(((_local2 * Math.pow(_arg1, _local3)) + _local4)));
        }

    }
}//package Classes.util 
